<template>
  <a-card :bordered="false">
    <!-- <ThirdPartyInfo ref="ThirdPartyInfo" @ok="modalFormOk"></ThirdPartyInfo> -->
    <!-- <ThirdPartyModal ref="modalForm" @ok="modalFormOk"></ThirdPartyModal> -->
    <ThirdPartyModel ref="modalForm" @ok="modalFormOk"></ThirdPartyModel>
    <div class="table-page-search-wrapper">
      <div class="header_left">
        <div class="header_left_top">
          <div class="icon_box">
            <i class="iconfont icon-31shouyexuanzhong"></i>
          </div>
          <div>
            <span class="name">碳排放报送</span>
            <p></p>
          </div>
        </div>
      </div>
      <div class="header_right">
        <!-- 操作按钮区域 -->
        <div class="table-operator">
          <a-button @click="handleAdd('第三方核查')" type="primary" icon="plus"
            >新增</a-button
          >
          <a-button
            @click="batchDel"
            v-if="selectedRowKeys.length > 0"
            ghost
            type="primary"
            icon="delete"
            >批量删除
          </a-button>
          <!--  -->
        </div>
        <!-- 表单搜索 -->
        <a-form class="form_" layout="inline" @keyup.enter.native="searchQuery">
          <a-form-item>
            <a-input
              placeholder="任务名称"
              v-model="queryParam.facilitiesName"
            ></a-input>
          </a-form-item>
          <span
            style="float: left; overflow: hidden"
            class="table-page-search-submitButtons"
          >
            <a-button type="primary" @click="searchQuery" icon="search"
              >查询</a-button
            >
            <a-button type="primary" @click="searchReset" icon="reload"
              >重置</a-button
            >
          </span>
        </a-form>
      </div>
    </div>
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
        <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择&nbsp;<a
          style="font-weight: 600"
          >{{ selectedRowKeys.length }}</a
        >项&nbsp;&nbsp;
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        style="height: 500px"
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{
          selectedRowKeys: selectedRowKeys,
          onChange: onSelectChange,
        }"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <act-custom-apply-btn
            @success="loadData"
            :data-id="record.id"
            :serviceName="serviceName"
            :variables="record"
            :assign="assign"
          ></act-custom-apply-btn>
          <!--<act-handle-btn @success="loadData" :data-id="record.id" :type="0" text="通过"></act-handle-btn>
          <act-handle-btn @success="loadData" :data-id="record.id" :type="1" text="驳回"></act-handle-btn>
          <act-handle-btn @success="loadData" :data-id="record.id" :type="2" text="退回"></act-handle-btn>
          <act-cancel-btn @success="loadData" :data-id="record.id"></act-cancel-btn>-->
          <act-historic-detail-btn
            :data-id="record.id"
          ></act-historic-detail-btn>
          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
    
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm
                  title="确定删除吗?"
                  @confirm="() => handleDelete(record.id)"
                >
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </a-table>
    </div>
  </a-card>
</template>
<script>
import { ListMixin } from "@/mixins/ListMixin";
import { deleteAction, postAction, getAction } from "@/api/manage";
// import ThirdPartyInfo from "./ThirdParty/ThirdPartyInfo.vue";
// import ThirdPartyModal from "./ThirdParty/ThirdPartyModal.vue";
import ThirdPartyModel from "./ThirdParty/ThirdPartyModal.vue";
import ActApplyBtn from "@views/flowable/components/ActApplyBtn";
import ActCustomApplyBtn from "@views/flowable/components/ActCustomApplyBtn";
import ActCancelBtn from "@views/flowable/components/ActCancelBtn";
import ActHandleBtn from "@views/flowable/components/ActHandleBtn";
import ActHistoricDetailBtn from "@views/flowable/components/ActHistoricDetailBtn";
import bus from "@/bus";
export default {
  name: "RoleUserList",
  mixins: [ListMixin],
  components: {
    ActCustomApplyBtn,
    ThirdPartyModel,
    ActApplyBtn,
    ActCancelBtn,
    ActHandleBtn,
    ActHistoricDetailBtn,
  },
  data() {
    return {
      columns: [
        {
          title: "任务名称",
          align: "left",
          dataIndex: "taskName",
        },
        {
          title: "状态 ",
          align: "left",
          scopedSlots: { customRender: "status" },
        },
        {
          title: "创建人",
          align: "left",
          dataIndex: "createBy_dictText",
        },
        {
          title: "创建时间",
          dataIndex: "createTime",
          align: "left",
          sorter: true,
        },
        {
          title: "备注",
          dataIndex: "remark",
          align: "left",
          sorter: true,
        },
        {
          title: "操作",
          dataIndex: "action",
          align: "left",
          scopedSlots: { customRender: "action" },
        },
      ],
      url: {
        list: "/check/third-party/list",
        delete: "/check/third-party/delete",
        deleteBatch: "/check/third-party/deleteBatch",
      },
      dataSource: [],
      assign:true,
      serviceName: "thirdPartyService",
    };
  },
  mounted() {
    // this.loadData();
  },
  methods: {
    emitViewReport(emitViewReport) {
      bus.$emit("emitViewReportFun", emitViewReport);
    },
  },
};
</script>
<style  lang="scss">
@import "@/assets/css/listcommon.scss";
@import "@/assets/css/InternalAudit.scss";
/* @import '~@assets/less/common.less'; */
/** Button按钮间距 */
.ant-btn {
  margin-left: 8px;
}
</style>